VERSION 5.00 Begin VB.Form frmDeleteFavorite BackColor = &H00000000& Caption = "Select a favorite to delete." ClientHeight = 3090 ClientLeft = 60 ClientTop = 405 ClientWidth = 4680 Icon = "frmDeleteFavorite.frx":0000 LinkTopic = "Form1" MaxButton = 0 'False ScaleHeight = 3090 ScaleWidth = 4680 StartUpPosition = 3 'Windows Default Begin VB.CommandButton cmdDelete Caption = "Delete Favorite" Height = 375 Left = 600 TabIndex = 2 Top = 2640 Width = 1455 End Begin VB.CommandButton cmdDone Caption = "Done" Height = 375 Left = 2640 TabIndex = 1 Top = 2640 Width = 1575 End Begin VB.ListBox List1 Height = 2400 Left = 120 TabIndex = 0 Top = 120 Width = 4455 End Attribute VB_Name = "frmDeleteFavorite" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Sub cmdCancel_Click() frmDeleteFavorite.Hide End Sub Private Sub cmdDone_Click() List1.Clear frmDeleteFavorite.Hide End Sub Private Sub cmddelete_Click() Dim rownumber As Integer x = List1.List(ListIndex) rownumber = List1.ListIndex List1.List(rownumber) = "" rownumber = 0 On Error GoTo errorhandler Open App.Path + "\Favorites" For Output As #1 Do Until rownumber = List1.ListCount '"" favorite = List1.List(rownumber) If List1.List(rownumber) <> "" Then Write #1, favorite rownumber = rownumber + 1 Loop Close #1 errorhandler: Exit Sub End Sub Private Sub Form_Activate() Dim favorites(1000) Open App.Path + "\Favorites" For Input As #1 Do While Not EOF(1) Input #1, favorites(x) List1.AddItem favorites(x) x = x + 1 Close #1 End Sub Private Sub Form_Unload(Cancel As Integer) List1.Clear End Sub Private Sub List1_Click() cmdDelete.Enabled = True End Sub